package com.situ.water_read.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.situ.water_read.pojo.RdRead;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.situ.water_read.pojo.RdTask;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author Angel
 * @since 2020-12-01
 */
@Mapper
public interface RdReadMapper extends BaseMapper<RdRead> {

    Integer selectEmpId(RdRead read);

    void updateAudit(Integer id);

    void updateread(RdTask task);

    //Map selectReadyByID(Map map);

    List<Map> selectListReadUser(@Param(Constants.WRAPPER) QueryWrapper wrapper);

    void updateAuditbycliak(Integer id);

    List<Map> queryAllDate();

    List<Map> queryAuditByID(RdRead read);

    IPage<Map> queryReadAll(@Param("page")Page<RdRead> page,@Param("read") RdRead read);

    Integer selectSum(RdRead read);

    List<Map> queryVolumeAll(@Param("year") Integer year, @Param("month") Integer month);

    IPage<Map> queryReadZero(@Param("page") Page<RdRead> page,@Param("read") RdRead read);

    Integer queryReadZeroSum(RdRead read);

    @Select("select r.*,e.empNmae from sy_emp e,Rd_Read r where r.AuditEmpID=e.id and userNo=#{value}")
    public List<Map> queryUserNo(String userNo);

    List<Map> queryAuditByUserNo(String userNO);

    List<Map> querywater(Map map);
}
